package com.ysd.lis.controller;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.WkHoliday;
import com.ysd.lis.service.WkHolidayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 节假日表 前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2024-03-19
 */
@RestController
@RequestMapping("/wk/holiday")
public class WkHolidayController extends BaseController {

    @Autowired
    WkHolidayService wkHolidayService;

    @GetMapping("/getHolidayList")
    public Result getHolidayList(@RequestParam("keyWord") String keyWord, @RequestParam("year") String year) {
        return wkHolidayService.getHolidayList(keyWord, year);
    }

    @PostMapping("/addHoliday")
    public Result addHoliday(@RequestBody WkHoliday wkHoliday) {
        return wkHolidayService.addHoliday(wkHoliday);
    }

    @PostMapping("/updateHoliday")
    public Result updateHoliday(@RequestBody WkHoliday wkHoliday) {
        return wkHolidayService.updateHoliday(wkHoliday);
    }
    @PostMapping("/deleteHolidayByIds")
    public Result deleteHolidayByIds(@RequestBody List<String> ids) {
        return wkHolidayService.deleteHolidayByIds(ids);
    }
}
